from django.conf.urls.defaults import *

urlpatterns = patterns('real_estate.views',
                       
#    url(r'^detail/(?P<property_slug>[-\w]+)/$', 'detail'),

#    url(r'^(?P<mode>[-\w]+)/state_(?P<state_slug>[-\w]+)/city_(?P<city_slug>[-\w]+)/suburb_(?P<suburb_slug>[-\w]+)/(?P<street_slug>[-\w]+)/(?P<postcode>\d{4})/$', view='index', name='index'),


    url(r'^(?P<mode>[-\w]+)/$', view='index', name='national'),
    url(r'^(?P<mode>[-\w]+)/type_(?P<property_type>[-\w]+)/bed_(?P<bedroom>[-\w]+)/bath_(?P<bathroom>[-\w]+)/garage_(?P<car_space>[-\w]+)/max_land_(?P<max_land_size>(\d{3,9}|unlimit))/min_land_(?P<min_land_size>(\d{3,9}|unlimit))/max_sale_(?P<max_sale_price>(\d{5,9}|unlimit))/min_sale_(?P<min_sale_price>(\d{5,9}|unlimit))/$',
        view='index', name='national'),

    url(r'^(?P<mode>[-\w]+)/state/(?P<state_slug>[-\w]+)/$',
        view='index', name='state'),
    url(r'^(?P<mode>[-\w]+)/state/(?P<state_slug>[-\w]+)/type_(?P<property_type>[-\w]+)/bed_(?P<bedroom>[-\w]+)/bath_(?P<bathroom>[-\w]+)/garage_(?P<car_space>[-\w]+)/max_land_(?P<max_land_size>\d{3,9}|unlimit)/min_land_(?P<min_land_size>\d{3,9}|unlimit)/max_sale_(?P<max_sale_price>\d{5,9}|unlimit)/min_sale_(?P<min_sale_price>\d{5,9}|unlimit)/$',
        view='index', name='state'),

    url(r'^(?P<mode>[-\w]+)/city/(?P<city_slug>[-\w]+)/$',
        view='index', name='city'),
    url(r'^(?P<mode>[-\w]+)/city/(?P<city_slug>[-\w]+)/type_(?P<property_type>[-\w]+)/bed_(?P<bedroom>[-\w]+)/bath_(?P<bathroom>[-\w]+)/garage_(?P<car_space>[-\w]+)/max_land_(?P<max_land_size>\d{3,9}|unlimit)/min_land_(?P<min_land_size>\d{3,9}|unlimit)/max_sale_(?P<max_sale_price>\d{5,9}|unlimit)/min_sale_(?P<min_sale_price>\d{5,9}|unlimit)/$',
        view='index', name='city'),

    url(r'^(?P<mode>[-\w]+)/suburb/(?P<suburb_slug>[-\w]+)/$',
        view='index', name='suburb'),
    url(r'^(?P<mode>[-\w]+)/suburb/(?P<suburb_slug>[-\w]+)/type_(?P<property_type>[-\w]+)/bed_(?P<bedroom>[-\w]+)/bath_(?P<bathroom>[-\w]+)/garage_(?P<car_space>[-\w]+)/max_land_(?P<max_land_size>\d{3,9}|unlimit)/min_land_(?P<min_land_size>\d{3,9}|unlimit)/max_sale_(?P<max_sale_price>\d{5,9}|unlimit)/min_sale_(?P<min_sale_price>\d{5,9}|unlimit)/$',
        view='index', name='suburb'),

    url(r'^(?P<mode>[-\w]+)/street/(?P<street_slug>[-\w]+)/$',
        view='index', name='street'),
    url(r'^(?P<mode>[-\w]+)/street/(?P<street_slug>[-\w]+)/type_(?P<property_type>[-\w]+)/bed_(?P<bedroom>[-\w]+)/bath_(?P<bathroom>[-\w]+)/garage_(?P<car_space>[-\w]+)/max_land_(?P<max_land_size>\d{3,9}|unlimit)/min_land_(?P<min_land_size>\d{3,9}|unlimit)/max_sale_(?P<max_sale_price>\d{5,9}|unlimit)/min_sale_(?P<min_sale_price>\d{5,9}|unlimit)/$',
        view='index', name='street'),

    url(r'^(?P<mode>[-\w]+)/postcode/(?P<postcode>\d{4})/$',
        view='index', name='postcode'),
    url(r'^(?P<mode>[-\w]+)/postcode/(?P<postcode>\d{4})/type_(?P<property_type>[-\w]+)/bed_(?P<bedroom>[-\w]+)/bath_(?P<bathroom>[-\w]+)/garage_(?P<car_space>[-\w]+)/max_land_(?P<max_land_size>\d{3,9}|unlimit)/min_land_(?P<min_land_size>\d{3,9}|unlimit)/max_sale_(?P<max_sale_price>\d{5,9}|unlimit)/min_sale_(?P<min_sale_price>\d{5,9}|unlimit)/$',
        view='index', name='postcode'),
)